/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */

/*
 * Credenza
 *
 * Copyright (C) 2000 Red Hat, Inc.
 *
 * Credenza is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * Credenza is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

/* credenza-application.h
 */

#ifndef CREDENZA_APPLICATION_H
#define CREDENZA_APPLICATION_H

#include <gdk/gdk.h>
#include <gio/gio.h>
#include <unique/unique.h>
#include <libegg/eggsmclient.h>
#include <libcredenza-private/credenza-undo-manager.h>

#define CREDENZA_DESKTOP_ICON_VIEW_IID	"OAFIID:Credenza_File_Manager_Desktop_Icon_View"

#define CREDENZA_TYPE_APPLICATION credenza_application_get_type()
#define CREDENZA_APPLICATION(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CREDENZA_TYPE_APPLICATION, CredenzaApplication))
#define CREDENZA_APPLICATION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), CREDENZA_TYPE_APPLICATION, CredenzaApplicationClass))
#define CREDENZA_IS_APPLICATION(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CREDENZA_TYPE_APPLICATION))
#define CREDENZA_IS_APPLICATION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CREDENZA_TYPE_APPLICATION))
#define CREDENZA_APPLICATION_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CREDENZA_TYPE_APPLICATION, CredenzaApplicationClass))

#ifndef CREDENZA_WINDOW_DEFINED
#define CREDENZA_WINDOW_DEFINED
typedef struct CredenzaWindow CredenzaWindow;
#endif

#ifndef CREDENZA_SPATIAL_WINDOW_DEFINED
#define CREDENZA_SPATIAL_WINDOW_DEFINED
typedef struct _CredenzaSpatialWindow CredenzaSpatialWindow;
#endif

typedef struct CredenzaShell CredenzaShell;

typedef struct {
	GObject parent;
	UniqueApp *unique_app;
        EggSMClient *smclient;
	CredenzaUndoManager *undo_manager;
	GVolumeMonitor *volume_monitor;
	unsigned int automount_idle_id;
	GDBusProxy *proxy;
	gboolean session_is_active;

	gboolean screensaver_active;
	guint ss_watch_id;
	GDBusProxy *ss_proxy;
	GList *volume_queue;
} CredenzaApplication;

typedef struct {
	GObjectClass parent_class;
} CredenzaApplicationClass;

GType                credenza_application_get_type          (void);
CredenzaApplication *credenza_application_new               (void);
void                 credenza_application_startup           (CredenzaApplication *application,
							     gboolean             kill_shell,
							     gboolean             no_default_window,
							     gboolean             no_desktop,
							     gboolean             browser_window,
							     const char          *default_geometry,
							     char               **urls);
GList *              credenza_application_get_window_list           (void);
GList *              credenza_application_get_spatial_window_list    (void);
unsigned int         credenza_application_get_n_windows            (void);

CredenzaWindow *     credenza_application_present_spatial_window     (CredenzaApplication *application,
								      CredenzaWindow      *requesting_window,
								      const char          *startup_id,
								      GFile               *location,
								      GdkScreen           *screen);
CredenzaWindow *     credenza_application_present_spatial_window_with_selection (CredenzaApplication *application,
										 CredenzaWindow      *requesting_window,
										 const char          *startup_id,
										 GFile               *location,
										 GList		     *new_selection,
										 GdkScreen           *screen);

void                 credenza_application_close_parent_windows     (CredenzaSpatialWindow *window);
void                 credenza_application_close_all_spatial_windows  (void);
void                 credenza_application_open_desktop      (CredenzaApplication *application);
void                 credenza_application_close_desktop     (void);
gboolean             credenza_application_save_accel_map    (gpointer data);


#endif /* CREDENZA_APPLICATION_H */
